package com.econ.powercloud.ems.common.enums;

/**
 * @author zjr
 * @description 遥信数据值枚举
 */
public enum YxValueType implements EnumMethod {
    //合位
    closed_position(0, "合位"),
    //分位
    break_position(1, "分位"),
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    YxValueType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(int code){
        for(YxValueType type: YxValueType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
